current_dir=$(shell pwd)
app_dxc_server_version=$(shell scripts/version.sh)
project_name=$(shell basename "${current_dir}" )
work_dir = /data/jenkins_home/workspace

test:
	chmod +x ./scripts/*.sh
	docker run --rm -v $(work_dir)/$(project_name):/go/src/git.multiverse.io/eventkit/dxc-server --name build_$(project_name) hub.multiverse.io/library/golang:1.13.12 /bin/bash /go/src/git.multiverse.io/eventkit/dxc-server/scripts/test.sh

build:
	chmod +x ./scripts/*.sh
	docker run --rm -v $(work_dir)/$(project_name):/go/src/git.multiverse.io/eventkit/dxc-server --name build_$(project_name) hub.multiverse.io/library/golang:1.13.12 /bin/bash /go/src/git.multiverse.io/eventkit/dxc-server/scripts/build.sh

clean:
	rm -rf bin

image: 
	sed 's/{{PROJECT_NAME}}/$(project_name)/' Dockerfile.template > Dockerfile
	docker build -t  $(registry)dxc-server:$(app_dxc_server_version).${BUILD_NUMBER} .

push:
	docker push    $(registry)dxc-server:$(app_dxc_server_version).${BUILD_NUMBER}
